<?php
include "../../public/common/config.php";
//$sql = "select brand.*,class.name cname from brand,class where brand.class_id = class.id";
$sql = "select brand.*,class.name cname from brand left join class on(brand.class_id = class.id)";
$result = mysql_query($sql);
//print_r($result);
?>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<!--<meta name="viewport" content="width=divice-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />-->
		<script src="https://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script>
		<link rel="stylesheet" type="text/css" href="../public/css/common.css"/>
		<title></title>
	</head>
	<body>
		<table>
			<tr><th>编号</th><th>品牌</th><th>类别</th><th>修改</th><th>删除</th></tr>
			<?php
			while($row = mysql_fetch_assoc($result)){
				echo "<tr>";
				echo "<td>{$row['id']}</td>";
				echo "<td>{$row['name']}</td>";
				echo "<td>{$row['cname']}</td>";
				echo "<td><a href='edit.php?id={$row['id']}'>修改</a></td>";
				echo "<td><a href='delete.php?id={$row['id']}'>删除</a></td>";
				echo "</tr>";
			}	
			?>
			
		</table>
	</body>
	
</html>
